<template>
  <panel title="商品数据表">
    <div ref="chart">
      <line-chart></line-chart>
    </div>
  </panel>
</template>

<script>
import Panel from '@/panel/Panel.vue';
import LineChart from '@/components/line/LineChart.vue';
export default {
  components: { Panel, LineChart },
  methods: {
    goods() {
      var myChart = this.$echarts.init(this.$refs.chart)
      myChart.setOption({
        title: {
          text: '商品销售额'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        color: [' #fac858', '#ee6666', '#73c0de', '#9a60b4', '#ea7ccc'],
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        legend: {},
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: [
          {
            name: '黄金蛋炒饭',
            type: 'line',

            data: [120, 132, 101, 134, 90, 230, 210]
          },
          {
            name: '红烧肉',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [220, 182, 191, 234, 290, 330, 310]
          },
          {
            name: '黄焖坤',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [150, 232, 201, 154, 190, 330, 410]
          },
          {
            name: '蒜泥白肉',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [320, 332, 301, 334, 390, 330, 320]
          },
          {
            name: '炸只因',
            type: 'line',
            stack: 'Total',
            label: {
              show: true,
              position: 'top'
            },
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [820, 932, 901, 934, 1290, 1330, 1320]
          }
        ]
      });
    }
  },
  mounted() {
    this.goods()
  }
};
</script>

<style lang="less" scoped>
div {
  min-height: 500px;
}
</style>